﻿/***********************************************************************************************
 * 
 * ProjectName: WMSSoft.Lib.Basic
 * 
 * Description: Class provides static methods use with configtypes used in config.xml. It 
 * 				corresponds with config.xsd.
 * 
 * Created:     01.07.2012
 * 
 * Author:      matthias wagler - matthias@WMSSoft.de
 * 
 * Copyright:   Copyright 2012 by WMSSoft.net
 * 
 * License:     GPLv3
 * 
 * History:     01.07.2012 - matthias wagler matthias@WMSSoft.de    -   Created
 * 
 **********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMSSoft.Lib.Basic
{
    public static class CConfigType
    {
        /// <summary>
        /// Returns a eConfigType - Enumeration - Value from the given string
        /// </summary>
        /// <param name="Name">string with the ConfigType</param>
        /// <returns>eConfigType - Enumeration Value</returns>
        public static EConfigTypes getConfigTypeEnumFromName(string Name)
        {
            if (Name != "")
                return (EConfigTypes)Enum.Parse(typeof(EConfigTypes), Name);
            else
                return EConfigTypes.None;
        }
            
        /// <summary>
        /// Function returns a Name for the given eConfigType Enumeration Value
        /// </summary>
        /// <param name="ConfigType">ConfigType Enumeration - Value</param>
        /// <returns>Value - Name</returns>
        public static string getConfigTypNameFromEnum(EConfigTypes ConfigType)
        {
            switch (ConfigType)
            {
                case EConfigTypes.Service:
                    return "Service";
                case EConfigTypes.Client:
                    return "Client";
                default:
                    return "";
            }
        }
    }
}
